package com.bright.springboot.core.config;

import com.bright.springboot.core.service.LinuxListService;
import com.bright.springboot.core.ListService;
import com.bright.springboot.core.service.WindowsListService;
import com.bright.springboot.core.condition.LinuxCondition;
import com.bright.springboot.core.condition.WindowsCondition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @Author Bright·SZ(zhanming.szm@alibaba-inc.com)
 * @Date 2019/7/16
 * @Description
 **/
@Configuration
public class ConditionConfig {

    @Bean
    @Conditional(WindowsCondition.class)
    public ListService windowsListService(){
        return new WindowsListService();
    }

    @Bean
    @Conditional(LinuxCondition.class)
    public ListService linuxListService(){
        return new LinuxListService();
    }
}
